import Vue from 'vue'
import Router from 'vue-router'
import index from '@/components/index/index'
import goods from '@/components/goods/index'
import person from '@/components/person/index'
import order from '@/components/order/index'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '*',
      redirect: '/index'
    },
    {
      path: '/',
      redirect: '/index'
    },
    {
      path: '/index',
      redirect: '/index/person',
      name: 'index'
    },
    {
      path: '/index',
      component: index,
      children: [
        {
          path: 'goods',
          name: 'goods',
          component: goods
        },
        {
          path: 'person',
          name: 'person',
          component: person
        },
        {
          path: 'order',
          name: 'order',
          component: order
        }
      ]
    }
  ]
})
